package com.yh.patterns.Iterator.task;

/**
 * @Author:云尚
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        IStudent iStudent=new ConcreteStudent();
        display(iStudent);
    }

    private static void display(IStudent iStudent) {
        Iterator iterator= iStudent.createIterator();
        System.out.println("按年龄从大到小排列");
        while (!iterator.hasNext()){
            System.out.println(iterator.currentItem());
            iterator.next();
        }
    }
}
